home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-07-03 | 761 b | 51 lines | [TEXT/R*ch] |
- %{
- open List
-
- fun say s = BasicIO.output(BasicIO.std_out, s);
- fun sayb s = say (s ^ " ");
- %}
-
- %token ID EQUALS NULL OPEN QUAL_ID STAR
- %token <string> ID QUAL_ID
- %token EOF
- %start MLtext
- %type <string list> MLtext MLfrag MLseq UnitName_seq LongIdent
- %type <string> UnitName Ident
-
- %%
- MLtext :
- MLseq EOF { $1 }
- | EOF { [] }
- ;
-
- MLfrag :
- NULL { [] }
- | LongIdent { $1 }
- | OPEN UnitName_seq { $2 }
- ;
-
- MLseq :
- MLfrag MLseq { $1 @ $2 }
- | MLfrag { $1 }
- ;
-
- UnitName_seq :
- UnitName UnitName_seq { $1 :: $2 }
- | /* empty */ { [] }
- ;
-
- UnitName :
- Ident { $1 }
- | EQUALS { "=" }
- ;
-
- Ident :
- ID { $1 }
- | STAR { "*" }
- ;
-
- LongIdent :
- Ident { [] }
- | QUAL_ID { [$1] }
- ;
-